import { Component, OnInit } from '@angular/core';
import { ConstantService } from '../service/constant.service';
import {templateJitUrl} from "@angular/compiler";

@Component({
  selector: 'app-navside',
  templateUrl: './navside.component.html',
  styleUrls: ['./navside.component.css'],
  providers: [ConstantService]
})
export class NavsideComponent implements OnInit {

  constructor(private constantService: ConstantService) { }

  navs = this.constantService.NAVS;

  ngOnInit() {

    var tmp = this.navs;
    if (sessionStorage.ulevel != 0){
 /*    for(var i =this.navs.length-1;i>=0;i--){
       if(this.navs[i].iscontrol =="1"){
         tmp.splice(i,1);
       }
     }*/

 for ( var i = 0; i < this.navs.length; i ++) {
   if (this.navs[i].iscontrol=="1") {
 tmp.splice(i , 1);
   }
 }
      this.navs = tmp;
    }



  }

}
